package com.PAT.UnSatisfying;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/12/19/11:48
 * @Description:
 * @Target: 差6
 */
public class 复数乘法 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        double R1 = in.nextDouble();
        double P1 = in.nextDouble();
        double R2 = in.nextDouble();
        double P2 = in.nextDouble();

        double RSum = R1*R2;
        double PSum = P1+P2;

        System.out.format("%.2f",(RSum*Math.cos(PSum)));
        if (RSum*Math.sin(PSum)<0){
            System.out.print("-");
            System.out.format("%.2f",Math.abs((RSum*Math.sin(PSum))));
        }else {
            System.out.format("%.2f",(RSum*Math.sin(PSum)));
        }

        System.out.print("i");
    }
}
